package _36define;

import java.util.Date;
import java.text.ParseException;
import java.text.SimpleDateFormat;

public class Demo3 {
    public static void main(String[] args) throws ParseException {

        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        String dateString1 = "2023-10-02";
        String dateString2 = "2001-10-23";
        String dateString3 = "2001-10-23";
        String dateString4 = "2001-10-23";
        Date date1 = sdf.parse (dateString1);
        Date date2 = sdf.parse (dateString2);
        Date date3 = sdf.parse (dateString3);
        Date date4 = sdf.parse (dateString4);


        Student3[] students = new Student3[4];
        
        students[0] = new Student3("zs", 18, "hubei", date1);
        students[1] = new Student3("ls", 17, "beijing",date2);
        students[2] = new Student3("wu", 19, "hubei", date3);
        students[3] = new Student3("zl", 21, "tianjin", date4);


        for (Student3 student : students) {
            System.out.println(student);
        }
    }
}
class Student3 {
    String name;
    int age;
    String location;
    Date birthday;

    public Student3(String name, int age, String location, Date birthday) {
        this.name  = name;
        this.age  = age;
        this.location  = location;
        this.birthday  = birthday;
    }

    @Override
    public String toString() {
        return "Name: " + name + ", Age: " + age + ", Location: " + location + ", Birthday: " + birthday.toString ();
    }
}
